<?php
class Myblog_Form_CommentsEdit extends Zend_Form
{
public $formDecorators=array(
array('FormElements'),
array('Form'),
);

public $selectDecorators=array(
array('ViewHelper'),
array('Label'),
array('Errors'),
array('HtmlTag',array('class'=>'selectadmin')),
);

	public function init()
	{
	$this->setAction('/admin/comments/edit')
		->setMethod('post')
		->setDecorators($this->formDecorators);
		
  
	$name=new Zend_Form_Element_Text('name');
	$name->setLabel('Изменить имя:')
		->setOptions(array('size'=>20))
		->setRequired(true)
		->addFilter('HtmlEntities')
		->addValidator('NotEmpty')
		->addFilter('StripTags')
		->addFilter('StringTrim');
		

	$email=new Zend_Form_Element_Text('email');
	$email->setLabel('Изменить Email:')
		->setOptions(array('rows'=>5,'cols'=>50))
		->setRequired(true)
		->addFilter('HtmlEntities')
		->addValidator('NotEmpty')
		->addFilter('StripTags')
		->addFilter('StringTrim')
		->addValidator('EmailAddress');

	$comment=new Zend_Form_Element_Textarea('blog_comment');
	$comment->setLabel('Комментарий:')
		->setOptions(array('rows'=>5,'cols'=>30))
		->setRequired(true)
		->addFilter('HtmlEntities')
		->addValidator('NotEmpty')
		->addFilter('StripTags')
		->addFilter('StringTrim');


	$date=new Zend_Form_Element_Text('created_dt');
	$date->setLabel('Изменить дату:')
		->setOptions(array('size'=>20,'class'=>'time'))
		->setRequired(true)
		->addFilter('HtmlEntities')
		->addValidator('NotEmpty')
		->addFilter('StripTags');

	$id=new Zend_Form_Element_Hidden('idn');
	$id->setOptions(array('size'=>1))
		->setRequired(true)
		->addFilter('HtmlEntities')
		->addValidator('NotEmpty')
		->addFilter('StripTags')
		->addValidator('Int')
		->removeDecorator('Label','dt')
		->removeDecorator('HtmlTag','dd')
		->addFilter('StringTrim');

	
	
	
	$submit=new Zend_Form_Element_Submit('submit');
	$submit->setLabel('Сохранить')
		->setOptions(array('class'=>'submit'));

	$this->addElements(array($name,$email,$date,$comment,$submit,$id));
	
	}
	
}
